Modified Serialization and De-serialization logic