Separate DB query logic, make it easy to add custom behavior