query abstraction