indexeddb code cleanup