Refactor unit tests.