Shifted gen script to external file