Seems hacky. Maybe add plugin system to activationfn/errorfn.