refactored connect-irc