flatten out main() a bit; no need for runCmd abstraction