Tree gen improvement