Refactor the testing infrastructure.