 // MARK: - TableView 📚
 extension ElongationViewController {
   
+  /// Must call `super` if you override this method in subclass.
   open override func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
     guard let cell = cell as? ElongationCell else { return }
     let expanded = state == .expanded
     cell.dim(expanded, animated: expanded)
-    changeOffset(of: cell)
+    cell.hideSeparator(expanded, animated: expanded)
+    
+    // 'Remove' separators from top and bottom cells
+    let numberOfRowsInSection = tableView.numberOfRows(inSection: indexPath.section)
+    if indexPath.row == 0 || indexPath.row == numberOfRowsInSection - 1 {
+      let separator = indexPath.row == 0 ? cell.topSeparatorLine : cell.bottomSeparatorLine
+      separator?.backgroundColor = UIColor.black
+    } else {
+      cell.topSeparatorLine?.backgroundColor = config.separatorColor
+      cell.bottomSeparatorLine?.backgroundColor = config.separatorColor
+    }
   }
   
   open override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {

    
    // Scroll to calculated rect only if it's not going to collapse whole tableView
    if force == nil {
      tableView.scrollToRow(at: indexPath, at: .middle, animated: animated)
    }
  }
  
  fileprivate func changeOffset(of cell: ElongationCell) {
    let cellFrame = cell.frame
    let cellFrameInTable = tableView.convert(cellFrame, to: UIScreen.main.coordinateSpace)
    let cellOffset = cellFrameInTable.origin.y + cellFrameInTable.size.height
    let tableHeight = tableView.bounds.size.height + cellFrameInTable.size.height
    let cellOffsetFactor = cellOffset / tableHeight
    cell.setFrontViewOffset(cellOffsetFactor)
  }
  
}

  
  open override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
    let isExpanded = cellStatesDictionary[indexPath] ?? false
    let frontViewHeight = config.topViewHeight
    let expandedCellHeight = config.bottomViewHeight + frontViewHeight - config.bottomViewOffset
    return isExpanded ? expandedCellHeight : frontViewHeight
  }
  
  /// Must call `super` if you override this method in subclass.
  open override func scrollViewDidScroll(_ scrollView: UIScrollView) {
    guard scrollView === tableView, config.parallaxEnabled else { return }
    for case let cell as ElongationCell in tableView.visibleCells {
      cell.parallaxOffset(offsetY: tableView.contentOffset.y, height: tableView.bounds.height)
    }
  }
 
