Move CTCP handling into its own method.