query_test cleaned up