Modified the database connection implementions