Refactor the spec files