Separated the GUI logic from the app logic