move a common function into a reductions module