some more slight refactoring
remove cId from go
refactor execCommand to reduce duplication