support different key type