unit test refactor