Move Sorting Out of MarkUp