extract save method to BaseDeviceController