Spec tests rewrite