refactoring domain query into separate method