refactoring gameboard