Use higher-order functions where possible.