diff --git a/lib/models/history.dart b/lib/models/history.dart
index b058519e5a7a1f92f5a15dc7ab3f271fcd031e96..4a28d0449f6483edfd90dcfd69aa8cf17818a58e 100644
--- a/lib/models/history.dart
+++ b/lib/models/history.dart
@@ -1,5 +1,6 @@
 import 'package:flutter/foundation.dart';
 import 'package:flutter/material.dart';
+import 'package:graphql_flutter/graphql_flutter.dart';
 import 'package:permission_handler/permission_handler.dart';
 import 'package:sentry/sentry.dart' as sentry;
 import 'package:qrscan/qrscan.dart' as scanner;
@@ -10,6 +11,9 @@ class HistoryProvider with ChangeNotifier {
   String pubkey = '';
   HistoryProvider(this.pubkey);
   final TextEditingController _outputPubkey = new TextEditingController();
+  bool isTheEnd = false;
+  List transBC;
+
   // String pubkey = 'D2meevcAHFTS2gQMvmRW5Hzi25jDdikk4nC4u1FkwRaU'; // For debug
 
   Future scan() async {
@@ -105,6 +109,44 @@ class HistoryProvider with ChangeNotifier {
     return transBC;
   }
 
+  FetchMoreOptions checkQueryResult(result, opts) {
+    final List<dynamic> blockchainTX =
+        (result.data['txsHistoryBc']['both']['edges'] as List<dynamic>);
+
+    final Map pageInfo = result.data['txsHistoryBc']['both']['pageInfo'];
+
+    final String fetchMoreCursor = pageInfo['endCursor'];
+
+    if (fetchMoreCursor != null) {
+      opts = FetchMoreOptions(
+        variables: {'cursor': fetchMoreCursor},
+        updateQuery: (previousResultData, fetchMoreResultData) {
+          final List<dynamic> repos = [
+            ...previousResultData['txsHistoryBc']['both']['edges']
+                as List<dynamic>,
+            ...fetchMoreResultData['txsHistoryBc']['both']['edges']
+                as List<dynamic>
+          ];
+
+          fetchMoreResultData['txsHistoryBc']['both']['edges'] = repos;
+          return fetchMoreResultData;
+        },
+      );
+    }
+
+    print(
+        "###### DEBUG H Parse blockchainTX list. Cursor: $fetchMoreCursor ######");
+    if (fetchMoreCursor != null) {
+      transBC = parseHistory(blockchainTX);
+      isTheEnd = false;
+    } else {
+      print("###### DEBUG H - Début de l'historique");
+      isTheEnd = true;
+    }
+
+    return opts;
+  }
+
   void resetdHistory() {
     this._outputPubkey.text = '';
     notifyListeners();
diff --git a/lib/screens/history.dart b/lib/screens/history.dart
index 9bc1248578647c4076ed51843bec5c7a5eccea65..f3ed4b51a9fe106bccd5306859b2f0912b3eeecc 100644
--- a/lib/screens/history.dart
+++ b/lib/screens/history.dart
@@ -14,8 +14,6 @@ class HistoryScreen extends StatelessWidget with ChangeNotifier {
   ScrollController scrollController = ScrollController();
   final nRepositories = 20;
   // HistoryProvider _historyProvider;
-  bool isTheEnd = false;
-  List _transBC;
   final _formKey = GlobalKey<FormState>();
   FocusNode _pubkeyFocus = FocusNode();
 
@@ -114,45 +112,10 @@ class HistoryScreen extends StatelessWidget with ChangeNotifier {
               return const Text('Aucune donnée à afficher.');
             }
 
-            final List<dynamic> blockchainTX =
-                (result.data['txsHistoryBc']['both']['edges'] as List<dynamic>);
-
-            final Map pageInfo =
-                result.data['txsHistoryBc']['both']['pageInfo'];
-
-            final String fetchMoreCursor = pageInfo['endCursor'];
-
             final num balance = _historyProvider
                 .removeDecimalZero(result.data['balance']['amount'] / 100);
 
-            if (fetchMoreCursor != null) {
-              opts = FetchMoreOptions(
-                variables: {'cursor': fetchMoreCursor},
-                updateQuery: (previousResultData, fetchMoreResultData) {
-                  final List<dynamic> repos = [
-                    ...previousResultData['txsHistoryBc']['both']['edges']
-                        as List<dynamic>,
-                    ...fetchMoreResultData['txsHistoryBc']['both']['edges']
-                        as List<dynamic>
-                  ];
-
-                  fetchMoreResultData['txsHistoryBc']['both']['edges'] = repos;
-                  return fetchMoreResultData;
-                },
-              );
-            }
-
-            print(
-                "###### DEBUG H Parse blockchainTX list. Cursor: $fetchMoreCursor ######");
-            if (fetchMoreCursor != null) {
-              _transBC = _historyProvider.parseHistory(blockchainTX);
-              isTheEnd = false;
-            } else {
-              print("###### DEBUG H - Début de l'historique");
-              isTheEnd = true;
-            }
-
-            // _historyProvider.resetdHistory();
+            opts = _historyProvider.checkQueryResult(result, opts);
 
             // Build history list
             return NotificationListener(
@@ -191,7 +154,7 @@ class HistoryScreen extends StatelessWidget with ChangeNotifier {
                       indent: 0,
                       endIndent: 0,
                     ),
-                    _transBC == null
+                    _historyProvider.transBC == null
                         ? Text('Aucune transaction à afficher.')
                         : loopTransactions(context, result),
                   ],
@@ -214,7 +177,7 @@ class HistoryScreen extends StatelessWidget with ChangeNotifier {
     HistoryProvider _historyProvider = Provider.of<HistoryProvider>(context);
 
     return Column(children: <Widget>[
-      for (var repository in _transBC)
+      for (var repository in _historyProvider.transBC)
         Padding(
             padding: const EdgeInsets.symmetric(horizontal: 8.0),
             child: ListTile(
@@ -249,7 +212,7 @@ class HistoryScreen extends StatelessWidget with ChangeNotifier {
             CircularProgressIndicator(),
           ],
         ),
-      if (isTheEnd)
+      if (_historyProvider.isTheEnd)
         Column(children: <Widget>[
           SizedBox(height: 15),
           Text("Début de l'historique.",