remove unneeded queries from beforemodel hook