- rewrite

- browserify compatibility
- separate scope