Change JSONparser class to method