Make refactoring in tests