refactored the tournament controller to the model