...
use ref instead of ptr
reorg