improving portfolio import script