clean main.js & mv js code out off view