added HOSTS_TO_PURGE setting and did some tidying up