Improve perf of submenu in commands