Refactored jsonParser and tests