Extracting chessboard formatting logic into a formatter class.