MainWindow divided into three classes