buy applyTo refactoring