more generic runCommand