remove unused code
make query object to pass in