urrgh. this was rather tough to get right. Main problem is avoiding switch-on-type.
I prefer this approach, so I can ignore threadsafety for the moment and add it later just by switching policy