Use class methods for serialization instead.