refactor deviceIGen