Refactor tests.