Generalize control script