refactoring around hwdec