Quick generate script optimization