Move JavaScript to external file