Tree builder extracted