wip: passing the script into a class

- more flexible
- more stable
- clean up