prepare for nested scopes
more ir helpers