Tests rewrite