Move script to separate file