added caching to _data classes to avoid creating a new type for each instance