Cleanup and cache team query