test refactoring and test patterns