This removes the need for `switch (obj)` in the template which is not allowed in strict mode. Additionally using a named variable speeds up rendering.