splitted class TreeGrapher into two classes