refactor basket.rb