Refactoring tests a little.