Simplify the code that recovery the last command metadata.