Add support for key_by