update struct of app, change middlewares