introduced prefabs for nodes, tidy up code