Extended version for importing in DB