extracted methods in MainWindow