first approach on nested tree builders