Updated database code in main code base