Browserify refactor