JSON refactor