Refactors test