Refactor spec files