use a higher-order function to customize step behaviour