spec refactoring