Added shared chat handling and extracted ChatListener as standalone class