rewritten bq and gs upload logic