Modified the way the cache is created