refactoring using DriverQueryCommand