refactored first implementation of dropbox upload