Cleaned code for upload from different bucket names