Refactored out shortcut handling to its own class.