Small refactoring in TextFunctions..