Tag Plugin: optimize javascript