.......... [ZBXNEXT-1300] refactored the code to discard the needless loop and adjusted return codes to stay compliant with our guidelines