diff --git a/dev/js/src/buttongroup.js b/dev/js/src/buttongroup.js
index b33c13a..a1dac7b 100644
--- a/dev/js/src/buttongroup.js
+++ b/dev/js/src/buttongroup.js
@@ -31,11 +31,11 @@
      */
     add : function (title, classes, cb) {
       var b = this._element.addE('span');
-      b.addT(title);
       b.setAttribute('title',title);
       if (classes !== undefined) {
         b.classList.add.apply(b.classList, classes);
       };
+      b.addE('span').addT(title);
 
       var that = this;
       b.addEventListener('click', function (e) {
diff --git a/dev/js/src/init.js b/dev/js/src/init.js
index b4621d0..76bbf82 100644
--- a/dev/js/src/init.js
+++ b/dev/js/src/init.js
@@ -15,6 +15,7 @@
   'hint',
   'vc',
   'tutorial',
+  'buttongroup',
   'lib/domReady',
   'vc/array',
   'lib/alertify',
@@ -29,6 +30,7 @@
              hintClass,
              vcClass,
              tutClass,
+             buttonGroupClass,
              domReady,
              vcArray,
              alertifyClass,
@@ -181,29 +183,19 @@
     };
 
     var result = d.getElementById('resultinfo');
-    var resultButton = null;
-    var leftButton = null;
+    var resultButton;
     if (result != null) {
 
-      // Add right buttons
-      resultButton = result.addE('div');
-      resultButton.classList.add('result', 'button');
-
-      leftButton =  result.addE('div');
-      leftButton.classList.add('result', 'button', 'left');
+      // Add result button group
+      resultButton = buttonGroupClass.create(['result']);
+      result.appendChild(resultButton.element());
     };
 
     // There is a koralQuery
     if (KorAP.koralQuery !== undefined) {
 
-      if (resultButton !== null) {
+      if (result !== null) {
         var kq;
-        var toggle = d.createElement('a');
-        toggle.setAttribute('title', loc.SHOW_KQ)
-        toggle.classList.add('show-kq', 'button');
-        toggle.addE('span')
-          .addT(loc.SHOW_KQ);
-        resultButton.appendChild(toggle);
 
         var showKQ = function () {
           if (kq === undefined) {
@@ -228,11 +220,8 @@
           };
         };
 
-        if (toggle !== undefined) {
-          
-          // Show koralquery
-          toggle.addEventListener('click', showKQ);
-        };
+        // Add KoralQuery button
+        resultButton.add(loc.SHOW_KQ, ['show-kq','button-icon'], showKQ);
       };
 
       if (KorAP.koralQuery["errors"]) {
@@ -263,41 +252,16 @@
     if (i > 0) {
 
       if (resultButton !== null) {
-
         /**
          * Toggle the alignment (left <=> right)
          */
-        // querySelector('div.button.right');
-        
-        var toggle = d.createElement('a');
-        toggle.setAttribute('title', loc.TOGGLE_ALIGN);
-        // Todo: Reuse old alignment from query
-        var cl = toggle.classList;
-        cl.add('align', 'right', 'button');
-        toggle.addEventListener(
-          'click',
-          function (e) {
-            var ol = d.querySelector('#search > ol');
-            ol.toggleClass("align-left", "align-right");
-            this.toggleClass("left", "right");
-          });
-        toggle.addE('span').addT(loc.TOGGLE_ALIGN);
-        resultButton.appendChild(toggle);
-      };
 
-      // Not ready yet
-      /*
-      if (leftButton !== null) {
-        var metaInfo = d.createElement('a');
-        metaInfo.setAttribute('title', loc.SHOW_META)
-
-        var cl = metaInfo.classList;
-        cl.add('show-meta', 'button');
-        metaInfo.appendChild(d.createElement('span'))
-          .appendChild(d.createTextNode(loc.SHOW_META));
-        leftButton.appendChild(metaInfo);
+        resultButton.add(loc.TOGGLE_ALIGN, ['align','right','button-icon'], function (e) {
+          var ol = d.querySelector('#search > ol');
+          ol.toggleClass("align-left", "align-right");
+          this.toggleClass("left", "right");
+        });
       };
-      */
     };
 
     /**
diff --git a/dev/js/src/match/info.js b/dev/js/src/match/info.js
index f30287b..628659f 100644
--- a/dev/js/src/match/info.js
+++ b/dev/js/src/match/info.js
@@ -1,6 +1,12 @@
 /**
  * Information about a match.
  */
+/*
+ * TODO:
+ *   Create a "views" object, that is the parent of this
+ *   class and supports a simple .add() method to add views
+ *   to an element.
+ */
 define([
   'match/infolayer',
   'match/table',
diff --git a/dev/js/src/match/treemenu.js b/dev/js/src/match/treemenu.js
index 6b8a76a..0010271 100644
--- a/dev/js/src/match/treemenu.js
+++ b/dev/js/src/match/treemenu.js
@@ -46,7 +46,7 @@
       return this._info;
     },
 
-    // Attach menu to
+    // Attach menu to button
     attachTo : function (e) {
 
       // this._attached = e;
