Extracted the main window to a seperate class