common serialization/dser methods

common serialization/dser methods