refactor handleKey:withModifiers: