How to access nested keys and their values to modify or delete all at once