Convert main method to App. Tidy formatting