refactory the ProcessId assignment of ProcessCommand.