Modify Device to inherit Device Type and other related classes: solve bugs