refactoring functional MonitorHostsTest