Refactors command execution to use a new log.Command helper that handles both logging and cmd creation, reducing duplication in sync.go