Refactored the way the application is initialized.