move utility stuff out to its own code so ops.go isn't cluttered