part of utils rewrite