dht: more clean code