I'm not sure what `key` and `val` should contain. Not documented.