clean up and simplify sale.rb