..F....... [ZBX-7399] refactored the code to avoid unnecessary in_array() calls