move create device logic to device class