Moved code from nodes to module