Refactoring: nodes.js