Implemented ContextTreeBuilder