simplify hosts.py