Refactoring
Simplified cache. More refactoring.