remove unneeded queries