Generalizing plugin loading/unloading behavior