Move script to its own file