Rework the plugin, remove old code