Some unit test refactoring.