Clean up the main file, add Application class