clean up the main window