buildmenu: code cleanup