Extracts a CacheKeyGenerator to get cache key logic clearer