Refactoring with BroadcastReceiver