removing unneeded queries