TextUtil class refactored