Improve parsing of json string