improve hash table logic
clean up