refactor hashtable