externalise javascript file