refactored mapQuery into instance methods