refactor for browser use without require