Rewrite Util to ts