Factored (update-in ...) into its own function.