configure middlewares in separate module