refactor: simplify menu code (#15559)