Issue #20715: Added some comments to the buildMenus function