Generalize the generation of ADT from raw types