Chat hook code cleanup.