Move before script to script file