refactor the unit tests