Refactored code to use messaging for content events.