Merge "Moving the remainder of reorder logic to ReorderAlgorithm" into main