index-based string manip and parsing for performance