Refactoring: nodes created as instances of the same function