refactored method order on Heap class