split script & main call