Simplify plugin.expose(). Closes #2229