refactoring data cache