Move the first iteration over the nodes into the iteration over the nodes where possible
Move the first iteration over the nodes into the iteration over the nodes where possible