Added db struct, replaced old authent vars