refactor compileTextNode