Json treatment moved to case classes