Added distinct aggregation helper