Refactoring addToNode macro routines