refactoring SessionCache