Rewrite tests