MaxHeap.cs refactoring