Extract js to its own file