Refactor some of the tests.