refactoring and tests for dropbox/dropstore