Refactor with browserify