could we do this with a template variable and push up the attribute access into a parameter for the definition?