refactor exceptions for plugin management.