Refactored some of the unit tests.