refactoring to move all device communication into a control service