Reorganize some backend irc functions