refactor delayedLeaf