Refactored interactive menu code