Refactored dropbox.js