Move Error handle related stuff to class Error.