Refactoring: dmd directory, device definitions