 			.rx_didDiscoverCharacteristicsForService
 			.filter { $0.0 == service.service }
 			.flatMap { (cbService, error) -> Observable<[Characteristic]> in
-				guard let characteristics = cbService.characteristics where error == nil else {
+				guard let rxCharacteristics = cbService.characteristics where error == nil else {
 					return Observable.error(BluetoothError.CharacteristicsDiscoveryFailed(service, error))
 				}
-				let mapped = characteristics.map { Characteristic(characteristic: $0, service: service) }
-				guard identifiers != nil else { return Observable.just(mapped) }
-				return Observable.just(mapped
-						.filter { self.shouldBeIdentifierIncluded($0.UUID, forIdentifiers: identifiers) })
+				let characteristics = rxCharacteristics.map { Characteristic(characteristic: $0, service: service) }
+				guard let characteristicIdentifiers = identifiers else { return Observable.just(characteristics) }
+                return Observable.just(characteristics.filter { characteristicIdentifiers.contains($0.UUID) })
             }
 			.take(1)
 

				.rx_didDiscoverIncludedServicesForService
				.filter { $0.0 == service.service }
				.flatMap { (service, error) -> Observable<[Service]> in
					guard let includedServices = service.includedServices where error == nil else {
						return Observable.error(BluetoothError.IncludedServicesDiscoveryFailed(self, error))
					}
					let mapped = includedServices.map { Service(peripheral: self, service: $0) }
					guard includedServiceUUIDs != nil else { return Observable.just(mapped) }
					return Observable
						.just(mapped.filter { self.shouldBeIdentifierIncluded($0.UUID, forIdentifiers: includedServiceUUIDs) }) }
				.take(1)

			return Observable.create { observer in

			.map { (self, $0) }
		return ensureValidPeripheralState(observable)
	}
}

extension Peripheral: Equatable { }
