Moving close_window to the MainWindow class