refactoring MonitorHostsTest