QuickSort, Assignment-2 and some refactoring