json sample update + refactoring