Refactoring of GenericCache.