refactor rspec, fix bad tests