Code to run in both, browser and server side