diff --git a/dev/js/src/init.js b/dev/js/src/init.js
index 54dc713..5d19cbd 100644
--- a/dev/js/src/init.js
+++ b/dev/js/src/init.js
@@ -259,7 +259,7 @@
     // There is more than 0 matches and there is a resultButton
     if (i > 0) {
 
-      if (resultPanel !== null) {
+      if (resultPanel) {
         /**
          * Toggle the alignment (left <=> right)
          */
diff --git a/dev/js/src/match.js b/dev/js/src/match.js
index 66def11..d5b365e 100644
--- a/dev/js/src/match.js
+++ b/dev/js/src/match.js
@@ -185,7 +185,8 @@
       // No reference found
       if (!refLine)
         return;
-      
+
+      // Create panel
       this.panel = matchPanelClass.create(this);
 
       this._element.insertBefore(
diff --git a/dev/js/src/panel/match.js b/dev/js/src/panel/match.js
index 2b220d3..7058a9a 100644
--- a/dev/js/src/panel/match.js
+++ b/dev/js/src/panel/match.js
@@ -78,7 +78,19 @@
           tm.button(this.button);
           tm.focus();
         }
-      )
+      );
+
+      // If plugins are enabled, add all buttons for the match panel
+      if (KorAP.Plugin) {
+        var matchButtons = KorAP.Plugin.buttonGroup("match");
+        if (matchButtons) {
+
+          // Add all matchbuttons in order
+          for (i in matchButtons) {
+            a.add.apply(a, matchButtons[i]);
+          }
+        };
+      };
 
       return this;
     },
diff --git a/dev/js/src/plugin/server.js b/dev/js/src/plugin/server.js
index c8df357..934f6f3 100644
--- a/dev/js/src/plugin/server.js
+++ b/dev/js/src/plugin/server.js
@@ -37,8 +37,10 @@
 
   // TODO:
   //   It may be useful to establish a watcher that pings
-  //   all widgets every second to see if it is still alive.
+  //   all widgets every second to see if it is still alive,
+  //   otherwise kill
   
+  // Load Plugin server
   return {
 
     /**
@@ -99,6 +101,7 @@
         throw new Error("Embedding of plugin is no list");
  
       // Embed all embeddings of the plugin
+      var that = this;
       for (var i in obj["embed"]) {
         var embed = obj["embed"][i];
 
@@ -118,19 +121,20 @@
         // The embedding will open a widget
         if (!onClick["action"] || onClick["action"] == "addWidget") {
 
-          var panel = document.getElementById(panel);
-          var that = this;
           var cb = function (e) {
 
+            // "this" is bind to the panel
+
             // Get the URL of the widget
-            var url = onClick["template"]; // that._interpolateURI(onClick["template"], this.match);
+            var url = onClick["template"];
+            // that._interpolateURI(onClick["template"], this.match);
 
             // Add the widget to the panel
-            var id = that.addWidget(panel, name, url);
+            var id = that.addWidget(this, name, url);
             plugin["widgets"].push(id);
           };
 
-          buttons[pannel].push([title, embed["classes"], cb]);
+          buttons[panel].push([title, embed["classes"], cb]);
         };
       };
     },
@@ -152,9 +156,9 @@
     },
     
     /**
-     * Open a new widget as a child to a certain element
+     * Open a new widget in a certaoin panel
      */
-    addWidget : function (element, name, src) {
+    addWidget : function (panel, name, src) {
 
       // Is it the first widget?
       if (!this._listener) {
@@ -185,12 +189,8 @@
       widgets[id] = widget;
       limits[id] = maxMessages;
 
-      // Open widget in frontend
-      // TODO:
-      //   Instead of an "element" this should probably be a 'panel' object!
-      element.appendChild(
-        widget.element()
-      );
+      // Add widget to panel
+      panel.add(widget);
 
       return id;
     },
@@ -280,5 +280,5 @@
       widgets = {};
       this._removeListener();
     }
-  }
+  };
 });
diff --git a/dev/js/src/plugin/widget.js b/dev/js/src/plugin/widget.js
index 338faa3..17c1f5e 100644
--- a/dev/js/src/plugin/widget.js
+++ b/dev/js/src/plugin/widget.js
@@ -2,25 +2,22 @@
  * The plugin system is based
  * on registered widgets (iframes) from
  * foreign services.
- * The widget component represents a single iframe.
+ * The widget component represents a single iframe and is
+ * implemented as a view object.
  *
  * @author Nils Diewald
  */
 
-define(["util"], function () {
+define(["view","util"], function (viewClass) {
   "use strict";
 
-  // Localization values
-  const loc   = KorAP.Locale;
-  loc.CLOSE     = loc.CLOSE     || 'Close';
-
   return {
 
     /**
      * Create new widget
      */
     create : function (name, src, id) {
-      return Object.create(this)._init(name, src, id);
+      return Object.create(viewClass)._init(['widget']).upgradeTo(this)._init(name, src, id);
     },
 
     // Initialize widget
@@ -32,68 +29,46 @@
     },
 
     /**
-     * The element of the widget
+     * The element of the widget as embedded in the view
      */
-    element : function () {
+    show : function () {
 
-      if (this._element)
-        return this._element;
-
-      var div = document.createElement('div');
-      div.classList.add('widget');
+      if (this._show)
+        return this._show;
 
       // Spawn new iframe
-      var i = div.addE('iframe');
+      var i = document.createElement('iframe');
       i.setAttribute('allowTransparency',"true");
       i.setAttribute('frameborder', 0);
       i.setAttribute('sandbox','allow-scripts');
       i.style.height = '0px';
       i.setAttribute('name', this.id);
       i.setAttribute('src', this.src);
-      this._iframe = i;
 
-      var ul = div.addE('ul');
-      ul.classList.add('action','right');
+      // Per default there should at least be a button
+      // for settings, if the plugin requires settings.
+      // Otherwise a button indicating this is a plugin
+      // is a nice idea as well.
 
-      // Add close button
-      var close = ul.addE('li');
-      close.addE('span').addT(loc.CLOSE);
-      close.classList.add('close');
-      close.setAttribute('title', loc.CLOSE);
+      this.actions.add(
+        this.name, ['button-icon', 'plugin'], function (e) {
 
-      // Add info button on plugin
-      var plugin = ul.addE('li');
-      plugin.addE('span').addT(this.name);
-      plugin.classList.add('plugin');
-      plugin.setAttribute('title', this.name);
-      
-      // Close match
-      close.addEventListener('click', function (e) {
-        e.halt();
-        this.shutdown()
+          // Temporary
+          window.alert("Basic information about this plugin");
       }.bind(this));
       
-      this._element = div;
-
-      return div;
-    },
-
-    // Return iframe of widget
-    iframe : function () {
-      if (this._iframe)
-        return this._iframe;
-      this.element();
-      return this._iframe;
+      this._show = i;
+      return i;
     },
 
     // Resize iframe
     resize : function (data) {
-      this.iframe().style.height = data.height + 'px';
+      this.show().style.height = data.height + 'px';
     },
 
     // Shutdown suspicious iframe
     shutdown : function () {
-      this._element.parentNode.removeChild(this._element);
+      this.element().parentNode.removeChild(this.element());
     }
   }
 });
diff --git a/dev/js/src/util.js b/dev/js/src/util.js
index 27c3d8d..cb60c2a 100644
--- a/dev/js/src/util.js
+++ b/dev/js/src/util.js
@@ -83,9 +83,6 @@
   KorAP.API = KorAP.API || {};
   KorAP.Locale = KorAP.Locale || {};
 
-  // This should load plugin/server
-  KorAP.Plugin = KorAP.Plugin || {};
-
   const loc = KorAP.Locale;
   loc.OR  = loc.OR  || 'or';
   loc.AND = loc.AND || 'and';
