         .map { (self, $0) }
         return ensureValidPeripheralState(observable)
     }
+
+    private func shouldBeIdentifierIncluded(identifier: CBUUID, forIdentifiers identifiers: [CBUUID]?) -> Bool {
+        if let identifiers = identifiers {
+            return identifiers.contains(identifier)
+        }
+        return true
+    }
 }
 
 extension Peripheral: Equatable {

     - Parameter identifiers: Identifiers of wanted services
     - Returns: Array of discovered services
     */
    public func discoverServices(identifiers: [CBUUID]) -> Observable<[Service]> {
        let observable = peripheral.rx_didDiscoverServices
        .flatMap({
            (services, error) -> Observable<[Service]> in
            if let discoveredServices = services {
                let mapped = discoveredServices
                .filter { identifiers.isEmpty || identifiers.contains($0.uuid) }
                .map { Service(peripheral: self, service: $0) as Service }
                return Observable.just(mapped)
            }
            return Observable.error(BluetoothError.ServicesDiscoveryFailed(self, error))
        })
        return Observable.deferred {
            self.peripheral.discoverServices(identifiers.isEmpty ? nil : identifiers)
            return self.ensureValidPeripheralState(observable)
        }
    }

    /**
     Triggers included services discovery.

     - Parameter service: The service whose included services you want to discover.
     - Returns: Returns array of included discovered services.
     */
    public func discoverIncludedServices(includedServiceUUIDs: [CBUUID]?, forService service: Service) -> Observable<[Service]> {
        let observable = peripheral.rx_didDiscoverIncludedServicesForService
        .flatMap{ (service, error) ->Observable<[Service]> in
            if let includedServices = service.includedServices where error == nil {
                let services = includedServices
                .filter { self.shouldBeIdentifierIncluded($0.uuid, forIdentifiers: includedServiceUUIDs) }
                .map { Service(peripheral: self, service: $0) }
                return Observable.just(services)
            }
            return Observable.error(BluetoothError.IncludedServicesDiscoveryFailed(self, error))
        }
        return Observable.deferred {
            self.peripheral.discoverIncludedServices(includedServiceUUIDs, forService: service.service)
            return self.ensureValidPeripheralState(observable)
        }
    }
