Reworked the db_init