Refactory: extract Board and Referee classes