Refactoring apply-0