Added a function to extract the identifier for a command