Refactored name of middleware function.