rewrite tests