Refactors some tests