Optimize visitor-facing JavaScript