Simplify and rename renameTextNodes