build up database connection
Minor changes