converting to browserify only
old code