Refactor Device type