add optimization for index.js