can we move these checks into the denodeify function body.