Refactored some tournament.rb code.