The code needs to be optimized because `renderTagAttributes()` is used frequently.