.......PS. [ZBX-8040] reverted unneeded changes
.......... [ZBX-7983] minor code refactoring