```\n    function _registerRecipient(bytes memory _data, address _sender)\n        internal\n        override\n        onlyActiveRegistration\n        returns (address recipientId)\n    {\n        …\n\n        uint8 currentStatus = _getUintRecipientStatus(recipientId);\n\n        if (currentStatus == uint8(Status.None)) {\n            // recipient registering new application\n            recipientToStatusIndexes[recipientId] = recipientsCounter;\n            _setRecipientStatus(recipientId, uint8(Status.Pending));\n\n            bytes memory extendedData = abi.encode(_data, recipientsCounter);\n            emit Registered(recipientId, extendedData, _sender);\n\n            recipientsCounter++;\n        } else {\n            if (currentStatus == uint8(Status.Accepted)) {\n                // recipient updating accepted application\n                _setRecipientStatus(recipientId, uint8(Status.Pending));\n            } else if (currentStatus == uint8(Status.Rejected)) {\n                // recipient updating rejected application\n                _setRecipientStatus(recipientId, uint8(Status.Appealed));\n            }\n            emit UpdatedRegistration(recipientId, _data, _sender, _getUintRecipientStatus(recipientId));\n        }\n    }\n```\n