serialize and deserialize abstraction

serialize and deserialize abstraction