refactoring apply/cancel caching