Merge "Refactor the error state" into mnc-ub-dev