Analytics and cleanup