rewrite type method