bit of refactoring to isolate browser and node paths