cleanup the take_ownership function a bit