replace google protocol buffer's serialization and deserialization methods