Refines auto_sort behaviour