code: func ns1ChangesByZone(zones []*dns.Zone, changeSets []*ns1Change) map[string][]*ns1Change {
  	changes := make(map[string][]*ns1Change)
  	zoneNameIDMapper := zoneIDName{}
  	for _, z := range zones {
  		zoneNameIDMapper.Add(z.Zone, z.Zone)
  		changes[z.Zone] = []*ns1Change{}
  	}
  
  	for _, c := range changeSets {
  		zone, _ := zoneNameIDMapper.FindZone(c.Endpoint.DNSName)
  		if zone == "" {
  			log.Debugf("Skipping record %s because no hosted zone matching record DNS Name was detected ", c.Endpoint.DNSName)
  			continue
  		}
  		changes[zone] = append(changes[zone], c)
  	}
  
  	return changes
  }
docs: // ns1ChangesByZone separates a multi-zone change into a single change per zone.