Reduce logic