Create device class and factory method.