tests rewrite