IBT: refactored, cleaned and replaced error codes