Better support for class serialization