Factor card DB out to its own module.