Tech Debt: refactor the js to it's own file