restructered scripts for v1 and v2