refactoring a spec