spec refactored