Improving insert_keys()