DRY'ed the database tables and writers.