Improve Serializer and Deserializer classes.