rewrite the script

- rewire the script in order to support new coding style
- update the site list support