extracted logic out of VC - improved tests