Refactored :all methods so the logic for queries and the id resolution i...

...s not scattered