extract common method from controllers to BaseDeviceController