Refactor controller creation into app.