First phase, move / refactor the piece of JavaScript that are included "inline" in the different views. They should be moved to their own file or re-using existing component or other solution.