                     return data as? [String: Any]
                 }
                 .subscribe(onNext: { value in
-                    guard let value = value else {
-                        observer.onError(TelegraphError.WrongResponse)
-                        return
-                    }
-                    
-                    guard let ok = value["ok"] as? Bool, ok else {
-                        if let error = value["error"] as? String {
-                            observer.onError(TelegraphError.ErrorResponse(errorCode: error))
-                        } else {
-                            observer.onError(TelegraphError.NoErrorCode)
-                        }
-                        return
-                    }
-                    
-                    guard let result = value["result"] as? [String: Any] else {
-                        observer.onError(TelegraphError.NoResult)
-                        return
-                    }
-                    
+                    guard self.checkError(observer: observer, value: value) else {
+                        return
+                    }
+                    
+                    let result = value?["result"] as! [String: Any]
+
                     guard let account = Account(JSON: result) else {
                         observer.onError(TelegraphError.WrongResultFormat)
                         return

                    return data as? [String: Any]
                }
                .subscribe(onNext: { value in
                    guard let value = value else {
                        observer.onError(TelegraphError.WrongResponse)
                        return
                    }
                    
                    guard let ok = value["ok"] as? Bool, ok else {
                        if let error = value["error"] as? String {
                            observer.onError(TelegraphError.ErrorResponse(errorCode: error))
                        } else {
                            observer.onError(TelegraphError.NoErrorCode)
                        }
                        return
                    }
                    
                    guard let result = value["result"] as? [String: Any] else {
                        observer.onError(TelegraphError.NoResult)
                        return
                    }
                    
                    guard let account = Account(JSON: result) else {
                        observer.onError(TelegraphError.WrongResultFormat)

                    return data as? [String: Any]
                }
                .subscribe(onNext: { value in
                    guard self.checkError(observer: observer, value: value) else {
                        return
                    }

                    let result = value?["result"] as! [String: Any]
                    
                    guard let account = Account(JSON: result) else {
                        observer.onError(TelegraphError.WrongResultFormat)
                        return
