Simplify the getText method in node