Menus: abstract out the leave this menu code so others can use it