refactored text lengths in parser