Moved type deserialization into exension method.