more unit test refactoring