Converted vars into nested

This is prep work towards sharing vars.