improved COMMANDS msg processing