Moved handling the trigger out of the plugin.