Implementing serialize/deserialize models.