             Network.getDelay(tripId: tripId, stopId: stopId).perform(withSuccess: { (json) in
                 if json["success"].boolValue {
                     guard let delay = json["data"]["delay"].int else {
-                        self.hideLiveElements()
                         self.setDepartureTimeAndLiveElements(withRoute: route)
                         return
                     }
                     
-                    let oneMinute = 60
-                    if delay >= oneMinute {
-                        let lateTime = direction.startTime.addingTimeInterval(TimeInterval(delay))
-                        self.setLiveElementsToLate(withDepartureTime: lateTime)
-                        
-                        self.setDepartureTime(withStartTime: Date(), withDepartureTime: lateTime, late: true)
-                    } else {
-                        self.setLiveElementsOnTime()
-                        self.setDepartureTimeOnTime()
+                    let departTime = direction.startTime
+                    let delayedDepartTime = departTime.addingTimeInterval(TimeInterval(delay))
+                    
+                    if Time.compare(date1: delayedDepartTime, date2: departTime) != .orderedSame {
+                        let delayState = DelayState.late(date: delayedDepartTime)
+                        self.setDepartureTime(withStartTime: Date(), withDelayState: delayState)
+                        self.setLiveElements(withDelayState: delayState)
+                    }
+                    else {
+                        let delayState = DelayState.onTime(date: departTime)
+                        self.setDepartureTime(withStartTime: Date(), withDelayState: delayState)
+                        self.setLiveElements(withDelayState: delayState)
                     }
                     
-                     route.getFirstDepartRawDirection()?.delay = delay
+                    route.getFirstDepartRawDirection()?.delay = delay
                 }
                 else {
-                    self.hideLiveElements()
-                    self.setDepartureTimeAndLiveElements(withRoute: route)                }
+                    self.setDepartureTimeAndLiveElements(withRoute: route)
+                }
             }, failure: { (error) in
                 print("RouteTableViewCell setLiveElements(withStartTime:, withDelay:) error: \(error.errorDescription ?? "") Request url: \(error.request?.url?.absoluteString ?? "")")
-                self.hideLiveElements()
                 self.setDepartureTimeAndLiveElements(withRoute: route)
             })
         }
         else {
-            self.hideLiveElements()
             if let route = route {
                 self.setDepartureTimeAndLiveElements(withRoute: route)
             }
         }
     }
-
+    
+    private func setLiveElements(withDelayState delayState: DelayState) {
+        
+        switch delayState {
+            
+        case .late(date: let delayedDepartureTime):
+            liveLabel.textColor = .liveRedColor
+            liveLabel.text = "Late - \(Time.timeString(from: delayedDepartureTime))"
+            liveIndicatorView.setColor(to: .liveRedColor)
+            
+        case .onTime(date: _):
+            liveLabel.textColor = .liveGreenColor
+            liveLabel.text = "On Time"
+            liveIndicatorView.setColor(to:.liveGreenColor)
+            
+        case .noDelay(date: _):
+            hideLiveElements()
+            
+        }
+        
+        liveLabel.sizeToFit()
+        positionLiveIndicatorView(usingLiveLabel: liveLabel)
+    }
+    
     private func hideLiveElements() {
         liveIndicatorView.setColor(to: .clear)
         liveLabel.textColor = .clear
     }
     
-    private func setLiveElementsOnTime() {
-        liveLabel.textColor = .liveGreenColor
-        liveLabel.text = "On Time"
-        liveIndicatorView.setColor(to:.liveGreenColor)
-        
-        liveLabel.sizeToFit()
-        positionLiveIndicatorView(usingLiveLabel: liveLabel)
-    }
-    
-    private func setDepartureTimeOnTime() {
-        departureTimeLabel.textColor = .liveGreenColor
-        arrowImageView.tintColor = .primaryTextColor
-    }
-    
-    private func setLiveElementsToLate(withDepartureTime departureTime: Date) {
-        liveLabel.textColor = .liveRedColor
-        liveLabel.text = "Late - \(Time.timeString(from: departureTime))"
-        liveIndicatorView.setColor(to: .liveRedColor)
-        
-        liveLabel.sizeToFit()
-        positionLiveIndicatorView(usingLiveLabel: liveLabel)
-    }
-    
-    private func setDepartureTime(withStartTime startTime: Date, withDepartureTime departureTime: Date, late: Bool) {
-        let boardTime = Time.timeString(from: startTime, to: departureTime)
-        departureTimeLabel.text = boardTime == "0 min" ? "Board now" : "Board in \(boardTime)"
-        departureTimeLabel.textColor = late ? .liveRedColor : .primaryTextColor
+    private func setDepartureTime(withStartTime startTime: Date, withDelayState delayState: DelayState) {
+        
+        switch delayState {
+            
+        case .late(date: let departureTime):
+            let boardTime = Time.timeString(from: startTime, to: departureTime)
+            departureTimeLabel.text = boardTime == "0 min" ? "Board now" : "Board in \(boardTime)"
+            
+            departureTimeLabel.textColor = .liveRedColor
+            
+        case .onTime(date: let departureTime):
+            let boardTime = Time.timeString(from: startTime, to: departureTime)
+            departureTimeLabel.text = boardTime == "0 min" ? "Board now" : "Board in \(boardTime)"
+            
+            departureTimeLabel.textColor = .liveGreenColor
+            
+        case .noDelay(date: let departureTime):
+            let boardTime = Time.timeString(from: startTime, to: departureTime)
+            departureTimeLabel.text = boardTime == "0 min" ? "Board now" : "Board in \(boardTime)"
+            
+             departureTimeLabel.textColor = .primaryTextColor
+            
+        }
+        
         arrowImageView.tintColor = .primaryTextColor
         
         departureTimeLabel.sizeToFit()

    private func setDepartureTimeAndLiveElements(withRoute route: Route) {
        let isWalkingRoute = route.isRawWalkingRoute()

        if let delayedDepartureTime = getDelayedDepartureTime(fromRoute: route) {
            if isWalkingRoute {
                setDepartureTimeToWalking()
            }
            else {
                setDepartureTime(withStartTime: Date(), withDepartureTime: delayedDepartureTime, late: true)
            }
            setLiveElementsToLate(withDepartureTime: delayedDepartureTime)
        }
        else {
            let departureTime = getDepartureTime(fromRoute: route)
            if isWalkingRoute {
                setDepartureTimeToWalking()
            }
            else {
                setDepartureTime(withStartTime: Date(), withDepartureTime: departureTime, late: false)
            }
        }
    }
    
    @objc func updateLiveElementsWithDelay() {

        return (departureTime: route.departureTime, arrivalTime: route.arrivalTime)
    }
    
    private func getDelayState(fromRoute route: Route) -> DelayState {
        if let firstDepartDirection = route.getFirstDepartRawDirection() {
            
            let departTime = firstDepartDirection.startTime
            
            if let delay = firstDepartDirection.delay {
                
                let delayedDepartTime = departTime.addingTimeInterval(TimeInterval(delay))
                
                if Time.compare(date1: delayedDepartTime, date2: departTime) != .orderedSame
                {
                    return .late(date: delayedDepartTime)
                }
                else {
                    
                    return .onTime(date: departTime)
                    
                }
                
            }
            else {
                
                return .noDelay(date: departTime)
                
            }
            
        }
        
        return .noDelay(date: route.departureTime)
        
    }

    // MARK: Set Data
