Finished refactoring tests