         // kickTableViewStressTest()
         // updateStandardUserDefaults()
     }
-
-    override var representedObject: Any? {
-        didSet {
-            // Update the view, if already loaded.
-        }
-    }
-}
-
-// MARK: Configure Views
-private extension MainViewController {
-    func buildViews() {
-        // use async to properly render border line. if not async, the line sometimes disappears
-        DispatchQueue.main.async {
-            self.communityImageView.layer?.borderWidth = 0.5
-            self.communityImageView.layer?.masksToBounds = true
-            self.communityImageView.layer?.borderColor = NSColor.black.cgColor
-        }
-        reconnectButton.isHidden = !enableDebugReconnectButton
-        if #available(macOS 10.14, *) {
-            speakButton.isHidden = false
-        } else {
-            speakButton.isHidden = true
-        }
-    }
-
-    func setupTableView() {
-        tableView.doubleAction = #selector(MainViewController.openUserWindow(_:))
-    }
-
-    func registerNibs() {
-        let nibs = [
-            (kNibNameRoomPositionTableCellView, kRoomPositionColumnIdentifier),
-            (kNibNameScoreTableCellView, kScoreColumnIdentifier),
-            (kNibNameCommentTableCellView, kCommentColumnIdentifier),
-            (kNibNameUserIdTableCellView, kUserIdColumnIdentifier),
-            (kNibNamePremiumTableCellView, kPremiumColumnIdentifier)]
-
-        for (nibName, identifier) in nibs {
-            guard let nib = NSNib(nibNamed: nibName, bundle: Bundle.main) else { continue }
-            tableView.register(nib, forIdentifier: convertToNSUserInterfaceItemIdentifier(identifier))
-        }
-    }
-}
-
-// MARK: Utility
-extension MainViewController {
-    func changeEnableCommentSpeech(_ enabled: Bool) {
-        // log.debug("\(enabled)")
-        updateSpeechManagerState()
-    }
-
-    func changeFontSize(_ fontSize: CGFloat) {
-        tableViewFontSize = fontSize
-
-        minimumRowHeight = calculateMinimumRowHeight(fontSize: tableViewFontSize)
-        tableView.rowHeight = minimumRowHeight
-        rowHeightCacher.removeAll(keepingCapacity: false)
-        tableView.reloadData()
-    }
-
-    func changeEnableMuteUserIds(_ enabled: Bool) {
-        MessageContainer.shared.enableMuteUserIds = enabled
-        log.debug("changed enable mute userids: \(enabled)")
-
-        rebuildFilteredMessages()
-    }
-
-    func changeMuteUserIds(_ muteUserIds: [[String: String]]) {
-        MessageContainer.shared.muteUserIds = muteUserIds
-        log.debug("changed mute userids: \(muteUserIds)")
-
-        rebuildFilteredMessages()
-    }
-
-    func changeEnableMuteWords(_ enabled: Bool) {
-        MessageContainer.shared.enableMuteWords = enabled
-        log.debug("changed enable mute words: \(enabled)")
-
-        rebuildFilteredMessages()
-    }
-
-    func changeMuteWords(_ muteWords: [[String: String]]) {
-        MessageContainer.shared.muteWords = muteWords
-        log.debug("changed mute words: \(muteWords)")
-
-        rebuildFilteredMessages()
-    }
-
-    private func rebuildFilteredMessages() {
-        DispatchQueue.main.async {
-            self.progressIndicator.startAnimation(self)
-            let shouldScroll = self.shouldTableViewScrollToBottom()
-
-            MessageContainer.shared.rebuildFilteredMessages {
-                self.tableView.reloadData()
-
-                if shouldScroll {
-                    self.scrollTableViewToBottom()
-                }
-                self.scrollView.flashScrollers()
-
-                self.progressIndicator.stopAnimation(self)
-            }
-        }
-    }
 }
 
 // MARK: - NSTableViewDataSource Functions
-extension MainViewController {
+extension MainViewController: NSTableViewDataSource {
     func numberOfRows(in tableView: NSTableView) -> Int {
         return MessageContainer.shared.count()
     }
-
+}
+
+// MARK: - NSTableViewDelegate Functions
+extension MainViewController: NSTableViewDelegate {
     func tableView(_ tableView: NSTableView, heightOfRow row: Int) -> CGFloat {
         let message = MessageContainer.shared[row]
 

    }
}

// MARK: Chat Message Utility (Internal)
extension MainViewController {
    func logSystemMessageToTableView(_ message: String) {
        appendTableView(message)
    }
}


private let safariCookieAlertDescription = "To retrieve the cookie from Safari, please open the Security & Privacy section of the System Preference and give the \"Full Disk Access\" right to Hakumai app."

// swiftlint:disable file_length
final class MainViewController: NSViewController {
    // MARK: - Properties
    static var shared: MainViewController!

