clean up json parsing