add erase method for hashtable
private copy and assignment; remove duplicate code