Refactoring for QueryRunner.