collapse run program code into runMacro() call