refactoring, DRY up query methods

Want to improve the code climate number