clean up code use StringParser for simple string parsing