Code cleanup, adding transactional query runner.