Use higher order functions.