Refactoring for node.go; Add node_test.go