Refactored some tests.