Refactor for browserify.