.......... [ZBX-3336] declared function in header, moved fuction closer to calling function