Updated to use database to pass config info around.