simplify keybinding toggles code