Right now, it looks like you're "converting" every alarm data structure regardless of its version. If that's the case, then this line will wipe out existing `registeredAlarms` data.

I think you could get around this by changing the argument order, but you can probably simplify this function if you bail out early for alarms that are in the correct format (as the previous line's comment implies).