Organized startDB function.