..F....... [ZBX-6596] refactored the code to provide a simpler solution