cleaned rehashing for searching