Improve main.js example