Clean up a bit in build_hash_tables