Refactor the menubar