Extracted a cache key generator