cleaned up applyTo