improvements for rspec-with function