Device refactoring