This could use the ivar instead, which would remove the need for the cleanup code on failure.