Refactor cache classes for consistent style