extract methods to make the board and ai clearer