Move js into seperate file