Added keyboard shortcut to connect

Plus minor changes and refactoring