Clean up analytics.query