JSON refactor - tidy up