Refactor + added 'connect' command
'connect' command