cleaned up MainWindowController to have a proper chain of events