     // MARK: - DFU Controller API
     
     override func pause() -> Bool {
-        if !aborted && dfuService != nil {
-            return dfuService!.pause()
-        }
-        return false
+        guard let dfuService = dfuService, !aborted else { return false }
+        return dfuService.pause()
     }
     
     override func resume() -> Bool {
-        if !aborted && dfuService != nil {
-            return dfuService!.resume() == false // resume() returns the 'paused' value
-        }
-        return false
+        guard let dfuService = dfuService, !aborted else { return false }
+        return dfuService.resume() == false // resume() returns the 'paused' value
     }
     
     override func abort() -> Bool {
         aborted = true
-        if dfuService != nil {
-            logger.w("Aborting upload...")
-            return dfuService!.abort()
-        }
-        // Peripheral is nil when the switchToNewPeripheralAndConnect(_ selector:DFUPeripheralSelector) method was called
-        // and the second peripheral has not been found yet.
-        // Delegate is nil when peripheral was destroyed.
-        if delegate != nil && peripheral == nil {
-            logger.w("Upload aborted. Part 1 flashed sucessfully")
-            centralManager.stopScan()
-            delegate?.peripheralDidDisconnectAfterAborting()
-        }
-        return true
+        
+        guard let dfuService = dfuService else {
+            // DFU service has not yet been found.
+            
+            // Peripheral is nil when the switchToNewPeripheralAndConnect(_ selector:DFUPeripheralSelector) method was called
+            // and the second peripheral has not been found yet.
+            // Delegate is nil when peripheral was destroyed.
+            if delegate != nil && peripheral == nil {
+                logger.w("Upload aborted. Part 1 flashed sucessfully")
+                centralManager.stopScan()
+                delegate?.peripheralDidDisconnectAfterAborting()
+            }
+            return true
+        }
+        
+        logger.w("Aborting upload...")
+        return dfuService.abort()
     }
     
     // MARK: - Private methods

     Method called when the device got disconnected.
     */
    func peripheralDidDisconnect() {
        if aborted {
            // The device has reseted. Notify user
            logger.w("Upload aborted")
            delegate?.peripheralDidDisconnectAfterAborting()
        } else {
            // Otherwise just notify the delegate about the disconnection
            // Most probably an error occur and will be reported to the user
            delegate?.peripheralDidDisconnect()
        }
    }
    
    /**

        } else {
            logger.i("Services discovered")
            
            guard !aborted else {
                resetDevice()
                return
            }
