Move JS to it's J own file and require it in application.js