improved export functionality