Replacing custom pact queries with model queries.
Refactored AllPacts queries using scopes.