move js into separate file