Refine JSON structure