add Resistance valued devices, some refactoring