try nils as an empty text nodes
refactor