Refactored broadcast receiver