optimized main.js