factor out base hashtable impl