         (selectedAnnotationView?.detailCalloutAccessoryView as? DetailAnnotationView)?.setup(with: counterOfcheckin)
     }
     
-    @objc func checkin() {
-        Answers.log(event: .MapButtons, customAttributes: "Check in")
-        checkinCount(with: +)
-    }
-    
-    @objc func unCheckin() {
-        Answers.log(event: .MapButtons, customAttributes: "Remove check in")
-        checkinCount(with: -)
-    }
+    @objc func checkin()   {    checkinCount(with: +, log: "Check in") }
+    
+    @objc func unCheckin() {    checkinCount(with: -, log: "Remove check in") }
 }
 
 //MARK: - Lists of function annotations

        Answers.logCustomEvent(withName: Log.sharedName.mapButtons, customAttributes: [Log.sharedName.mapButton: "Pressd CellView"])
        let seletedItem = listToDisplay[indexPath.item]
        changeToMapview()
        if !mapView.annotations.contains { $0.title  == seletedItem.title } { mapViewMove(to: seletedItem) }
        mapView.selectAnnotation(seletedItem, animated: true)
        collectionView.deselectItem(at: indexPath, animated: false)
    }


//MARK: - Checkin functions
extension MapViewController {
    private func checkinCount(with calculate: (Int, Int) -> Int, log: String) {
        defer { DataManager.saveToDatabase(with: batteryStationAnnotations) }
        Answers.log(event: .MapButtons, customAttributes: log)
        guard let batteryAnnotation = selectedAnnotationView?.annotation as? BatteryStationPointAnnotation else { return }
        let counterOfcheckin = calculate(batteryAnnotation.checkinCounter ?? 0, 1)
        batteryAnnotation.checkinDay = counterOfcheckin > 0 ? Date.today : ""
