refactor the hashtable