separate the script to external page