Incorrect fix is reverted
1) originSessionId is added to DeviceCommand
2) minor refactoring