Refactor depricated rspec functionality