refactored code_menu