Refactored unit tests.