Extract _populate_reason function