indexeddb code clean up