restructured application.js