renamed from_class to from_data