added json
refactoring