refactor menu code into menuhelper class