(menu_action.c) Get rid of some code duplication