cleaning up main window, later into global action