Updated db management a bit