included type and ref in ToDataType

Addresses #34