small changes to NodeFactory for linkedlists