Move js into separate file