generalized legacy script