Extract menu item tap handler code