refactored the unit tests