added code generator for extended type