Refactored the error messages to plugin classes