fixes #8526 - allow plug-ins to modify multiple hosts actions

Refactoring patern: Extract method.