Compartmenatalise some of the code in the application constructor.