Re factored the way that DB class are loaded.