reduce getWritableDatabase calls