refactor Device class within module