restructured script and removed external dependency file