ENH factor out minor-axis reduce operation and reuse for sum