Refactoring reduction_by_head strategy