Updating the menu to use a closure function and avoid the switch.