MainWindow refactoring and such