use refs instead of target