..F....... [ZBX-8302] ported refactorings from ZBX-8302