used the var substitutor to replace some of the vars