Tree generation improvement