Optimize Node#each_descendant by extracting recursion helper method