Review feedback: rename _duplicatekey() to handle_duplicate_key()