Shouldn't this be delegating to the datatype? E.g datatype.deserialize(valueReference)