Moved all DB access to inside DBConnection

Moved all DB access to inside DBConnection