change to generic tree