fix https://github.com/remotestorage/remotestorage.js/pull/509#discussion_r8013775
refactor https://github.com/remotestorage/remotestorage.js/pull/509#discussion_r8013810
self-explaining code https://github.com/remotestorage/remotestorage.js/pull/509#discussion_r8013807