Minor refactor in json.c