create a query object, refactoring runner and tests