Refactored the QuickSort class.