Added ExtractEntitiesCommand updated code