Re-factored loading of app