Add Application class. Put application initialization code to Application class. Place some code into separate functions.