generate type handler