introduced refcounting on policy and connections