Moved some logic from the Dropbox engine into core.