Refactored with automatic fromJson