Refactoring and enforcement of JSON format