..F....... [ZBXNEXT-2124] minor code refactoring to reduce nesting