.......PS. [ZBX-8188] simplify the code