Refactored Reordering into algebraic typeclasses.