Move script to seperate file