refactoring; started JSON parsing