Improved structure of main app.