Moved common functionality to base Heap class