extend text parsing refactoring