move the database connection code to a separate file