Create an application class to take some of the burden

Change-Id: I7058a3eb9958dff869986c8ac2300937f4f2e140
Use the application class for control flow

Change-Id: Ia683386934d47175416308fa8236196338e0b410