Code clen up for NodeModel