 				.rx_didDiscoverIncludedServicesForService
 				.filter { $0.0 == service.service }
 				.flatMap { (service, error) -> Observable<[Service]> in
-					guard let includedServices = service.includedServices where error == nil else {
+					guard let includedRxServices = 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) }) }
+					let includedServices = includedRxServices.map { Service(peripheral: self, service: $0) }
+					guard let includedServiceUUIDs = includedServiceUUIDs else { return Observable.just(includedServices) }
+                    return Observable.just(includedServices.filter { includedServiceUUIDs.contains($0.UUID) })
+
+                }
 				.take(1)
 
 			return Observable.create { observer in

			.rx_didDiscoverCharacteristicsForService
			.filter { $0.0 == service.service }
			.flatMap { (cbService, error) -> Observable<[Characteristic]> in
				guard let characteristics = 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) })
            }
			.take(1)


	public func discoverServices(serviceUUIDs: [CBUUID]?) -> Observable<[Service]> {
		let observable = peripheral.rx_didDiscoverServices
			.flatMap {
				(_, error) -> Observable<[Service]> in
				if let cachedRxServices = self.peripheral.services  {
					let cachedServices = cachedRxServices.map { Service(peripheral: self, service: $0) }
					guard let identifiers = serviceUUIDs else { return Observable.just(cachedServices) }
					let uuids = cachedServices.map { $0.service.uuid }
					if Set(identifiers).isSubsetOf(Set(uuids)) {
                        let filteredServices = cachedServices
                            .filter { identifiers.contains($0.UUID)}
						return Observable.just(filteredServices)
					}
					return Observable.empty()
				}
