consolidate code to invoke menus