Simplify global-shortcut's code.