Node cleanup

Uses "normal" interation without the lambda to prevent another object in the stack.

removed unused code.
Merge pull request #4543 from ricardoquesada/node_cleanup

Node cleanup