refactor main window on windows platform