Audited the error codes and removed all unused codes