refactored menu code into MLMenu class.