refactor to device id