refactore delayedLeaf