Move private sorting-related methods out of merge_sort and quick_sort function bodies.