refactored
append text nodes for each token