move JavaScript to seperate file