Refactoring in unit tests