Isolated socket functionality and renamed socket to 'chat'