Refactoring and adding some style to error message