refactoring out the channel name creation to it's own method.
Adding pattern matches for connect and disconnect; using the state record instead of a tuple.