privatize serialize/deserialize