refactor the ExceptionMessage class to Messages class