This is tough to parse. Might be better as something nested or some intermediate vars?