Heap sort, refactoring