Write basic deserializer for objects