refactored to be OO, rspec passing