Couldn't this be made to return an `error`, since each caller might need to clean up things?