Refactoring to use browserify