Refactors tests