Refactoring for browserify