moving dbconnect to model