refactored JSON calls into an own class