improvements to json parsing