finish refactoring tests