device service refactoring