Extract codes that create compile and execute commands as Command class