refactoring of devicetpe
refactoring of database