Update the way to deal with the Menu Button + clean up the code