refactoring ManageHostsTest