                     break
                 }
             default:
-                let lastRow = self.tableView.numberOfRows(inSection: indexPath.section) - 1
-
-                // Delete category button
-                if indexPath.row == lastRow && self.existingCustomCategory {
-                    self.onDeleteCategory()
-                }
                 break
+            }
+        case Section.deleteCategory.rawValue:
+            if self.existingCustomCategory {
+                self.onDeleteCategory()
             }
         default:
             break

                    return cell
                }
            default:
                let lastRow = self.tableView.numberOfRows(inSection: indexPath.section) - 1

                // Delete category button will only show for existing custom categories
                if indexPath.row == lastRow && self.existingCustomCategory {
                    guard let cell = self.tableView.dequeueReusableCell(
                        withIdentifier: SCConstants.identifier.deleteCategoryViewCell.rawValue
                    ) as? SCTableViewCell else {
                        return SCTableViewCell()
                    }

                    cell.primaryLabel.text = SCStrings.primaryLabel.deleteCategory.rawValue
                    cell.indexPath = indexPath

                    return cell
                }

                // Display words in the list
                guard let cell = self.tableView.dequeueReusableCell(
                    withIdentifier: SCConstants.identifier.wordViewCell.rawValue
                    ) as? SCTextFieldViewCell else {

    enum Section: Int {
        case settings = 0
        case wordList = 1
        case deleteCategory = 2
    }

    enum Setting: Int {
