A.F....... [ZBX-8349] messageType->mesageInvalid transition and minor refactoring