refactor to use request and browser-request