small cache refactoring