Little fix: changed getCommandsFromText logic, added private clear method