moved common code for running sql into runner struct