Updated database handling