Refactor some tests.