refactoring ErrorCode