Code refactoring in QuickSorter