Refactoring in spec_helper