[NFC] Refactor identification of reductions as common utility function.