refactored to HTTree => HeadTailTree