moved some functionality outside setupNode