main.js cleaning