Refactored to avoid parsing text into JSON only to turn the JSON back into text on the same line.

This way we just take the text as a string more simply.