Minor clean up of keyboard shortcut code