Wrote whenRegistered, used in plugins, tidied up plugins in general