applyToEach functions