started refactoring cache mechanism