Rework fn table-cmds-to-str for better clarity