snap js optimized