Extract rspec before ruby refactoring
Minor code reorder