Removing unused code and adding extra rspec tests