[Keymap] Some code cleanup.