take db through ctor; this makes way more sense