Realised all of these examples are for async, but they apply equally for sync.