Refactoring Devices module