better fromJson functions