optimize use on browser
support config. Fixes #16