Refactor app.d to 100 line limit