Refactored message handlers