upgrade rspec, minor refactoring