Eliminate num_leaves variable