extract js into external file