As the logic must be used with AirplaneModeHelper, I would suggest to extract related code to a module, so that we can see the relationship between this module and AirplaneModeHelper more easily.