You've just misread that. One is @type, the other is @name so I can't reuse the variable.

It's ok, it was deliberate. I know the Portal side of the code takes this value and calls toLowerCase() so I left the call to capitalize() out.