[Refactor] 3D and 2D json code