moved DB access to separate object