Broke-out run_cmd() into the parts of its sum