refactor beer.rb