MergeSorted optimization