Refactor cache.