Refactor with some new function

add: 
* debounce and throttle
* multi-instance support
* print logs when debug