Refactors the tests