Rehash functionality for hash table