Refactoring json