Abstracted out the code for starting to listen on a ws into its own method