Refactored the Exception class.