refactored some unit tests