Refactoring to move error messages to Macros