Add deserialize and convert to a library