generalize key type