heavy refactoring reducing db and disk access on the UI thread, detected by StrictMode