Use thread-safe collections, instead of manually synchronizing