Refactoring spec test