now redundant with more general structdata2class function