cleaning up some queries