Refactored unit test.