There are a lot of these ifdefs. Is it possible to consolidate this by moving them into ReadDB and WriteDB themselves? Would be a lot less noisy.