Clean up query a bit