refactored rspec