refactored_main_window_constructor