cache is now in place with better refactoring