collections-and-sync code and tests