rewrite type api