closes #9 changes structure of CBData to a Struct with Union + type inside