shifted settings and configuration out from the middlewares