Pull the handler for the route out into a named function