code cleanup, move creation of nodes to correct classes