Improving and simplifying BroadcastReceiver