Refactor ErrorHandler class more cleanly.