spec refactor