refactored chessboard