refactor the spec