decoupled db and cache, moved fields to record class