Isolating task javascript in a new file