refactored code and createFromExcel now creates or updates based on csid