Refactoring and cache strategy example