Remove dependency on getHierarchyHeights()

Remove dependency on getHierarchyHeights()