Added extract_entity_id