refactoring JSON