Querying your database DRYly