Move inline JavaScript to separate file