improved performance of leaf selection.