refactored menu mechanism