Pushed logging, db connection out to util module.