refactor 2 random variables