modify the code to reduce copy

reduce copy of python built in json module