You can continue using sync, but having callback makes it easier to pass stuff around. If we want to move this to a util function, it has to have a callback as it can't rely on a global variable.