refactoring json