more json refactor