Refactor unit test.