refactoring mainwindow menu