Split reduce function