CacheManager: Performance improvements and cleanup