rework data handling - extract to json