code simplify
modified for vcsharing