AdGenerator refactored to pull from DB