Refactors test client