All these `unset()` calls could be avoided by moving the plugin loading logic to a function.