refactored json parsing performing methods for more readability