Removed all non-thread-safe db scans.