Refactor of some of the unit tests.