JsonDiff: reorganize code