Refactoring: declare Player and Board outside functions