move some logic back to marctojson.go