refactor menu management