Refactored the variables sequence of error messages