optimize ket of first-level key