Refactored the unit tests.