better class serialization support