Refactoring tests