Plugin error handling.
Refactor plugins (Remove duplicated code).