Cache class refactoring