Please move this to the 'utils.js' file under util folder. We should avoid spreading utility functions all over the place.