refactoring (moved "connected" value out of device ids)