Refactored to use Browserify