Refact ErrorHandler