Remove unnecessary middlewares