TODO: thread safe dict emulating?