Support customized middlewares