refactor to only affect json parsing