refactor to isolate randomVar methods from inside factor class (poodr).