Refactoring cachedecorator