config is now passed around to maintain states