Major refactoring completed to ErrorHandler class.